{extend name="layout/base" /}
{block name="css"}
<style>
    .layui-upload-file {
        display: none !important;
    }
</style>
{/block}
{block name="content"}
<div class="content business">
    <h2>信息填写</h2>
    <div class="container">
        <form class="form-inline" action="">
            <div class="form-group">
                <label class="col-sm-2 control-label">企业名称</label>
                <div class="col-sm-10">
                    <input type="text" name="name" class="form-control" placeholder="请输入企业名称">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">联系人</label>
                <div class="col-sm-10">
                    <input type="text" name="linkman" class="form-control" placeholder="请输入联系人姓名">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">联系电话</label>
                <div class="col-sm-10">
                    <input type="text" name="phone" class="form-control" placeholder="请输入联系电话">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">详细地址</label>
                <div class="col-sm-10">
                    <input type="text" name="address" class="form-control" placeholder="XX省XX市XX县XX街道">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label label-top">企业介绍</label>
                <div class="col-sm-10">
                    <textarea class="form-control" name="desc" rows="8" cols="80" placeholder="请输入企业介绍"></textarea>
                </div>
            </div>
            <div class="form-group company-pic-box">
                <label class="col-sm-2 control-label company-pic">公司图片</label>
                <div class="col-sm-10">
                    <img class="upload-file" id="upload-file" src="__CDN__/assets/img/upload-file.png" alt="">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-12">
                    <p>注：需上传门店照片1张以上，店内环境照2张以上</p>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" checked name="xieyi"> 我已阅读并同意《经销商入驻协议》
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-1 col-sm-11">
                    <button type="submit" class="btn btn-default lg btn-block btn-submit ajax-post" target-form="form-inline">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
{block name="script"}
<script>
layui.use('upload', function(){
    var upload = layui.upload
    ,layer = layui.layer;
    //执行实例
    var uploadInst = upload.render({
        elem: '#upload-file'
        ,url: "{:url('ajax/upload')}"
        ,multiple: true
        ,done: function(res){
            if(res.code) {
                var html = "<img src='"+ res.data.url +"'><input name='pic[]' type='hidden' value='" + res.data.url + "'>";
                $('#upload-file').before(html);
            }
        }
        ,error: function(){
            layer.msg(res.msg)
        }
    });
});
</script>
{/block}
